﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using Microsoft.Office.Interop.Word;
using vmlModel.Entities;

namespace WPFSLVstoDesigner
{
    public class ConverterMngr
    {

        public Canvas GenerateXAMLDoc(OoxmlDoc xDoc)
        {
            Canvas ShapeFather = new Canvas();
            foreach (var vmlChildShape in xDoc.vmlChildernShapes)
            {
                if (vmlChildShape.GetType() == typeof(vmlRect))
                {
                    ShapeFather.Children.Add(new XAMLFactory.SimpleShapesBuilder().CreateRectangle((vmlChildShape as vmlRect)));
                }
                if (vmlChildShape.GetType() == typeof(vmlRoundrect))
                {
                    ShapeFather.Children.Add(new XAMLFactory.SimpleShapesBuilder().CreateRectangle((vmlChildShape as vmlRoundrect)));
                }
                if (vmlChildShape.GetType() == typeof(vmlOval))
                {
                    ShapeFather.Children.Add(new XAMLFactory.SimpleShapesBuilder().CreateEllipse((vmlChildShape as vmlOval)));
                }
                //-------------------------Paths
                if (vmlChildShape.GetType() == typeof(vmlShape))
                {
                    (vmlChildShape as vmlShape).ShapeType = (from s in xDoc.vmlShapeTypes
                                                             where s.vmlObjID == (vmlChildShape as vmlShape).vmlType 
                                                             select (vmlShapeType)s).SingleOrDefault();
                    ShapeFather.Children.Add(new XAMLFactory.PathShapesBuilder().CreatePath((vmlChildShape as vmlShape)));
                }

            }
            return ShapeFather;

        }


        public Canvas CreateShapesXAML(Shapes officeShapes)
      {
       Canvas ShapeFather = new Canvas();
        
       foreach (Shape shp in officeShapes)
       {
           
           switch (shp.AutoShapeType)
           {
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape10pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape12pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape16pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape24pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape32pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape4pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape5pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape6pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape7pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShape8pointStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonBackorPrevious:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonBeginning:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonCustom:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonDocument:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonEnd:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonForwardorNext:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonHelp:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonHome:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonInformation:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonMovie:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonReturn:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeActionButtonSound:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeArc:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeBalloon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeBentArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeBentUpArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeBevel:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeBlockArc:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCan:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeChartPlus:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeChartStar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeChartX:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeChevron:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeChord:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCircularArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCloud:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCloudCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCorner:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCornerTabs:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCross:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCube:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCurvedDownArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCurvedDownRibbon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCurvedLeftArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCurvedRightArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCurvedUpArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeCurvedUpRibbon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDecagon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDiagonalStripe:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDiamond:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDodecagon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDonut:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDoubleBrace:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDoubleBracket:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDoubleWave:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDownArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDownArrowCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeDownRibbon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeExplosion1:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeExplosion2:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartAlternateProcess:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartCard:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartCollate:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartConnector:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartData:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartDecision:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartDelay:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartDirectAccessStorage:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartDisplay:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartDocument:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartExtract:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartInternalStorage:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartMagneticDisk:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartManualInput:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartManualOperation:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartMerge:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartMultidocument:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartOfflineStorage:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartOffpageConnector:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartOr:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartPredefinedProcess:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartPreparation:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartProcess:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartPunchedTape:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartSequentialAccessStorage:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartSort:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartStoredData:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartSummingJunction:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFlowchartTerminator:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFoldedCorner:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFrame:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeFunnel:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeGear6:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeGear9:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeHalfFrame:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeHeart:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeHeptagon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeHexagon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeHorizontalScroll:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeIsoscelesTriangle:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftArrowCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftBrace:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftBracket:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftCircularArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftRightArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftRightArrowCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftRightCircularArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftRightRibbon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftRightUpArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLeftUpArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLightningBolt:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout1:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout1AccentBar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout1BorderandAccentBar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout1NoBorder:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout2:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout2AccentBar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout2BorderandAccentBar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout2NoBorder:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout3:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout3AccentBar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout3BorderandAccentBar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout3NoBorder:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout4:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout4AccentBar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout4BorderandAccentBar:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineCallout4NoBorder:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeLineInverse:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeMathDivide:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeMathEqual:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeMathMinus:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeMathMultiply:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeMathNotEqual:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeMathPlus:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeMixed:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeMoon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeNoSymbol:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeNonIsoscelesTrapezoid:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeNotPrimitive:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeNotchedRightArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeOctagon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeOval:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeOvalCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeParallelogram:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapePentagon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapePie:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapePieWedge:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapePlaque:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapePlaqueTabs:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeQuadArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeQuadArrowCallout:
                   break;
                   // rects
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle:
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRoundedRectangle:
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRound1Rectangle:
                              
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangularCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRegularPentagon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRightArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRightArrowCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRightBrace:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRightBracket:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRightTriangle:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRound2DiagRectangle:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRound2SameRectangle:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeRoundedRectangularCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeSmileyFace:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeSnip1Rectangle:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeSnip2DiagRectangle:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeSnip2SameRectangle:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeSnipRoundRectangle:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeSquareTabs:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeStripedRightArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeSun:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeSwooshArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeTear:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeTrapezoid:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeUTurnArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeUpArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeUpArrowCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeUpDownArrow:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeUpDownArrowCallout:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeUpRibbon:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeVerticalScroll:
                   break;
               case Microsoft.Office.Core.MsoAutoShapeType.msoShapeWave:
                   break;
               default:
                   break;
           } 
       }

       return ShapeFather;
      }
    }
}
